#pragma once
#include "stdafx.h"
#include "GamePlayer.h"
#include "GameResources.h"
#include "GameMap.h"
#include "HarmEffective.h"
#include "EnemyInfantry.h"
#include "FriendInfantry.h"
#include "StartUi.h"
#include "InjureEffective.h"
#include "StateBar.h"


void on_mouse(int event, int x, int y, int flags, void* param);

class CGameManage
{
public:
	CGameManage();
	~CGameManage();
	void GameRun();
	void InitGame();
	void PlayerUpdate();
	void HarmEffectiveUpdate();
	void EnemyUpdate();
	void FriendUpdate();
	void PlayStartAnimation();
	void StateBarUpdate();
	void CheckPointRun();
private:
	CGameResources _GameResources;
	CGameMap _GameMap;
	IplImage *m_SrcBg, *m_Bg, *m_ShowBg;
	CGamePlayer _Player;
	vector<CHarmEffective *>_HarmEffective;
	vector<CEnemyInfantry *>_EnemyInfantry;
	vector<CFriendInfantry *>_FriendInfantry;
	vector<CInjureEffective *>_InjureEffective;
	CStartUi _StartAnimation;
	CStateBar _StateBar;
	int m_EnemyCount, m_FriendCount;
	bool m_isWin;
	int m_NowCheckPoint;
public:
	void CheckPointInit();
	void EndGame();
};